import dayjs from 'dayjs'
import React, { useEffect, useState } from 'react'
import './index.css'

const IndexPage = () => {
  const [time, $time] = useState('')
  useEffect(() => {
    $time(dayjs().format('YYYY-MM-DD HH:mm:ss'))
    setInterval(() => {
      const date = dayjs().format('YYYY-MM-DD HH:mm:ss')
      $time(date)
    }, 1000)
  }, [])

  return (
    <>
      <div id="home-container">
        <div className="container-left">
          <div className="logo"></div>
          <h1 className="time">{time}</h1>
        </div>
      </div>
    </>
  )
}

export default IndexPage
